package com.cloud.shopping.goods.controller;


import com.cloud.shopping.goods.model.SkuAttribute;
import com.cloud.shopping.goods.service.SkuAttributeService;
import com.cloud.shopping.tool.RespResult;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author John.zhang
 * @since 2020-12-28
 */
@Api(tags = "商品属性模块")
@RestController
@RequestMapping("/skuAttribute")
public class SkuAttributeController {

    @Resource
    private SkuAttributeService skuAttributeService;

    /**
     * 根据分类ID查询属性集合
     */
    @GetMapping(value = "/category/{id}")
    public RespResult<List<SkuAttributeController>> categorySkuAttributeList(@PathVariable(value = "id")Integer id){
        List<SkuAttribute> skuAttributes = skuAttributeService.queryList(id);
        return RespResult.ok(skuAttributes);
    }
}

